From: Florian Müllner Date: Thu, 27 Nov 2025 17:56:17 +0000 (+0100) Subject: test-tool: Add --extension option X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~68 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9aa2cc5b2599f31edbf49a4e89449d5cb7b47b65;p=gnome-shell.git test-tool: Add --extension option The tool is currently used for running gnome-shell's own tests, but it could also be used by extensions to automate their testing. To support that use case, add an --extension option that installs the provided extension zip and enables the extension before starting gnome-shell. Part-of: --- diff --git a/src/gnome-shell-test-tool.in b/src/gnome-shell-test-tool.in index c6c31436b..a16d2be86 100755 --- a/src/gnome-shell-test-tool.in +++ b/src/gnome-shell-test-tool.in @@ -26,6 +26,17 @@ class GSettingsConfig(ConfigParser): with open(f'{dir}/keyfile', 'w') as keyfile: self.write(keyfile) +def install_extension(extension, env): + self_dir = os.path.dirname(os.path.abspath(sys.argv[0])) + args = [] + args.append(os.path.join(self_dir, 'gnome-extensions')) + args.append('install') + args.append('--print-uuid') + args.append(extension) + + proc = subprocess.run(args, env=env, check=True, capture_output=True, text=True) + return proc.stdout.strip() + def show_version(option, opt_str, value, parser): print("GNOME Shell Test Tool @VERSION@") sys.exit() @@ -52,6 +63,10 @@ def start_shell(xdg_home, wrap=None, perf_output=None): if os.getenv('SHELL_BACKGROUND_IMAGE') is None: env['SHELL_BACKGROUND_IMAGE'] = '@pkgdatadir@/perf-background.xml' + if options.extension: + uuid = install_extension(options.extension, env=env) + gsettings_config.add('org/gnome/shell', 'enabled-extensions', f'["{uuid}"]') + self_dir = os.path.dirname(os.path.abspath(sys.argv[0])) args = [] if wrap: @@ -239,6 +254,8 @@ parser.add_argument("--hotplug", action="store_true", parser.add_argument("--disable-animations", action="store_true", help="Run with animations disabled") +parser.add_argument("--extension", + help="Run with extension installed and enabled") options = parser.parse_args()